package cn.darkhorse.device.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.text.Collator;

/**
 * 设备监控
 * @author yuanjun
 * @since 2022/12/15 9:52
 */
@Data
@Accessors(chain = true)
public class MesDeviceMonitorVO  implements Comparable<MesDeviceMonitorVO> {
    Long deviceId;
    /**
     * 工段
     */
    String teamName;

    /**
     * 设备名称
     */
    String deviceName;
    /**
     * 设备状态
     */
    String deviceStatus;
    /**
     * 状态优先级
     */
    Integer orderIndex;

    @Override
    public int compareTo(MesDeviceMonitorVO mesDeviceMonitorVO) {
//        if (getOrderIndex() > mesDeviceMonitorVO.getOrderIndex()) {
//            return 1;
//        }else if (getOrderIndex() < mesDeviceMonitorVO.getOrderIndex()) {
//            return -1;
//        }
//        return 0;

        Collator collator = Collator.getInstance();
        return  collator.compare(getDeviceName(),mesDeviceMonitorVO.getDeviceName());
    }
}

